package matching.propertyPath;

import java.util.ArrayList;

import org.semanticweb.owl.model.OWLClass;

public class PropertyPath {
	public ArrayList<Property> path;
	OWLClass source;
	OWLClass target;
	
	public PropertyPath() {
		path = new ArrayList<Property>();
	}
	
	public void addLink(Property p) throws Exception{
		if(path.size()==0){
			path.add(p);
			source = p.domain;
			target = p.range;
		}else{
			Property p2 = path.get(path.size()-1);
			if(p2.range.toString().equals(p.domain)){
				path.add(p);
				target = p.range;
			}else throw new Exception("invalid path");
		}
	}
}
